﻿// ===============================================================================
// XCI.NET 西安交通信息WinForm开发框架 2018 版权所有
// ===============================================================================
using System;
using XCI.Core;

namespace XCI.Data.Entity
{
    /// <summary>
    /// 实体列信息
    /// </summary>
    public class EntityColumn
    {
        /// <summary>
        /// 属性名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 列名
        /// </summary>
        public string DbName { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Caption { get; set; }

        /// <summary>
        /// 导出
        /// </summary>
        public bool Export { get; set; }

        /// <summary>
        /// 是否可见
        /// </summary>
        public bool Visable { get; set; }

        /// <summary>
        /// 列属性
        /// </summary>
        public FastProperty Property { get; internal set; }

        /// <summary>
        /// 设置属性值
        /// </summary>
        public void SetValue(object target, object val) { Property.Set(target, val); }

        /// <summary>
        /// 获取属性值
        /// </summary>
        public object GetValue(object target) { return Property.Get(target); }
    }
}
